﻿using SenGe.Domain;

namespace SenGe.Application
{
    /// <summary>
    /// 用户相关服务接口
    /// </summary>
    public interface ISenUserService : IBaseService
    {
        /// <summary>
        /// 检查数据库链接
        /// </summary>
        /// <returns></returns>
        Task<bool> CheckDbConnection();
        /// <summary>
        /// 检查注册信息
        /// </summary>
        /// <param name="model">注册模型</param>
        /// <returns></returns>
        Task<UserRegisterCheckResult> CheckRegisterInfo(UserRegisterModel model);
        /// <summary>
        /// 通过编号获取用户注册模型
        /// </summary>
        /// <param name="id">用户编号</param>
        /// <returns></returns>
        Task<UserRegisterModel?> GetUserRegisterModel(long id);
        /// <summary>
        /// 新增用户
        /// </summary>
        /// <param name="model">用户模型</param>
        /// <returns></returns>
        Task<bool> AddOrUpdateUser(UserRegisterModel model);
        /// <summary>
        /// 通过登录用户名获取用户Dto
        /// </summary>
        /// <param name="userName">登录用户名</param>
        /// <returns></returns>
        Task<DtoSenUser?> GetUserByUserName(string userName);
        /// <summary>
        /// 通过用户编号获取用户Dto
        /// </summary>
        /// <param name="id">用户编号</param>
        /// <returns></returns>
        Task<DtoSenUser?> GetUserById(long id);
        /// <summary>
        /// 修改用户密码
        /// </summary>
        /// <param name="user">用户模型</param>
        /// <returns></returns>
        Task<bool> ChangePassWord(DtoSenUser user);
        /// <summary>
        /// 更新最新登录时间
        /// </summary>
        /// <param name="user">用户模型</param>
        /// <returns></returns>
        Task<bool> UpdateLastLoginTime(DtoSenUser user);
    }
}
